<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./lib/echarts.min.js"></script>

    <!-- 必须准备一个有宽高的盒子 -->
    <div style="width: 600px; height: 400px;"></div>


    <script>
        // 1.固定语法   初始化echarts
        // let myChart = echarts.init(div盒子)
        let myChart = echarts.init(document.querySelector('div'))
        // 2.配置图标   
        let option = {
            xAxis: {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: [150, 230, 224, 218, 135, 147, 260],
                    type: 'line'
                }
            ]
        }
        // 3.固定语法   创建图表
        myChart.setOption(option)
    </script>
</body>

</html>